 import java.util.*;
   import java.io.*;
	
   public class Ej05 {
      public static void main(String[] args) {
         FileWriter fw= null; 
         PrintWriter pw = null;
         FileReader fr=null;
         BufferedReader br=null;
         try {
         	//Inicializamos lectura
            fr= new FileReader("dat/enlaces.txt"); 
            br = new BufferedReader(fr);
         	//Inicializamos escritura
            fw= new FileWriter("dat/enlaces.htm"); 
            pw = new PrintWriter(fw);
         	//--------------------
            pw.println("<h1>Mis enlaces</h1>");
            String linea=null;
            while ((linea=br.readLine())!=null) {
               String[] datos=linea.split(";");
               pw.println("<h2><a href=\""+datos[1]+"\">"+ datos[0]+"</a></h2>");
            }
         
         }
         	
            catch (Exception e) {e.printStackTrace();} 
         finally {
            try {
               if (fw != null ) {fw.close();}
               if (fr != null ) {fr.close();}
            } 
               catch (Exception e2) {e2.printStackTrace();}
         }
      }
   }